﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="danh_sach_nguoi_dung.ascx.cs" Inherits="Admin_Module_danh_sach_nguoi_dung" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadAjaxManager OnAjaxRequest="Ajax_Request" ID="RadAjaxManager1" runat="server" 
    DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grd" />
            </UpdatedControls>
        </telerik:AjaxSetting>
       
        <telerik:AjaxSetting AjaxControlID="grd">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grd" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>

<telerik:RadWindowManager OnClientClose="Window_Close" ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow VisibleStatusbar="false" Width="800px" Height="600px" runat="server" ID="windows1"></telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function Window_Close() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }
    </script>
</telerik:RadCodeBlock>

<asp:Label runat="server" ID="lblMessage"></asp:Label>

<fieldset>
    <legend>Danh Sách </legend>
   
    
    <a href="/Admin/Form/User_Add.aspx" class="link-add-new" ><img src="/Image/add2.png" alt="Thêm mới người dùng" title="Thêm mới người dùng" />Thêm Mới</a>
    
    <telerik:RadGrid AllowPaging="true" PageSize="20" runat="server" Skin="WebBlue" 
        AllowFilteringByColumn="True" AutoGenerateColumns="false" ID="grd" 
        onpageindexchanged="grd_PageIndexChanged" GridLines="Horizontal" >
        <MasterTableView NoDetailRecordsText="Không Có Dữ Liệu">
            <Columns>
                <telerik:GridTemplateColumn HeaderText="Tài Khoản" DataField="UserName">
                    <ItemTemplate>
                        <a href="/Admin/Form/User_Add.aspx?id=<%#DataBinder.Eval(Container.DataItem,"UserID")%>">
                            <%# Eval("UserName")%>
                        </a>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn HeaderText="Email" DataField="Email" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="Họ Tên" AllowFiltering="true">
                    <ItemTemplate>
                        <%# (Eval("FirstName").ToString() + Eval("LastName").ToString())%>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Giới Tính" DataField="Sex" AllowFiltering="true">
                    <ItemTemplate>
                        <%# ((Eval("Sex").ToString() == "1")?"Nam":"Nữ") %>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn HeaderText="Ngày Sinh" DataField="Birthday" DataType="System.DateTime"  AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn Visible="false" HeaderText="Điện Thoại" DataField="Mobile" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn Visible="false" HeaderText="Địa Chỉ" DataField="Address" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="Ngày Đăng Ký" DataField="RegDate" DataType="System.DateTime"  AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn Visible="false" HeaderText="Tên Công Ty" DataField="CompanyName" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn Visible="false" HeaderText="Địa Chỉ Công ty" DataField="CompanyAddress" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn Visible="false" HeaderText="Fax" DataField="Fax" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn Visible="false" HeaderText="Vị trí" DataField="Position" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn Visible="false" HeaderText="Công việc" DataField="Job" AllowFiltering="true"></telerik:GridBoundColumn>
                
                <telerik:GridCheckBoxColumn DataField="IsActive"></telerik:GridCheckBoxColumn>
                <telerik:GridTemplateColumn HeaderText="Kiểu Người Dùng" DataField="UserType" AllowFiltering="true">
                    <ItemTemplate>
                        <%#
                            GetUserType(Convert.ToByte(Eval("UserType")))                      
                        %>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    
    
</fieldset><p>
    &nbsp;</p>

